#include "RBTree.h"

void test1()
{
	// int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	int a[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
	RBTree<int, int> t;
	for (const auto& e : a) {
		t.insert(make_pair(e, e));
	}
	t.InOrder();
	cout << t.IsBalance() << endl;
}

void test2()
{
	const int N = 10000;
	srand(unsigned int(time(nullptr)));

	vector<unsigned int> v;
	for (int i = 1; i <= N; ++i) v.push_back(rand());

	RBTree<unsigned int, unsigned int> t;
	for (const auto& e : v) {
		// cout << "Insert:" << e << endl;
		if (e == 15724) {
			int j = 1;
		}
		t.insert({ e, e });
	}
	// t.InOrder();
	cout << t.IsBalance() << endl;
	cout << t.GetHeight() << endl;
}

int main()
{
	test2();
	return 0;
}